package nomo.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import nomo.dao.IAdminDao;
import nomo.model.Admin;
import nomo.model.AdminDTO;
@Service
public class AdminServicesImpl implements IAdminService {
	@Resource
	private IAdminDao dao;

	@Override
	public Admin login(Admin a) {
		return dao.login(a);
	}

	@Override
	public int add(Admin a) {
		return dao.add(a);
	}

	@Override
	public int edit(Admin a) {
		return dao.edit(a);
	}

	@Override
	public int del(int id) {
		return dao.del(id);
	}

	@Override
	public int editPwd(AdminDTO a) {
		int n=0;
		Admin admin=dao.getAdminByPwd(a);
		if (admin!=null) {//如果旧密码验证通过
			n=dao.editPwd(a);
			
		}
		return n;
	}

	@Override
	public List<Admin> findAll(Admin am) {
		// TODO Auto-generated method stub
		return dao.findAll(am);
	}

}
